home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / OpenDoc Utilities / Interfaces / BndNSUtl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-01  |  4.9 KB  |  140 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        BndNSUtl.h
  3.  
  4.     Contains:    Binding utilities for EditorSetup.
  5.  
  6.     Owned by:    Reggie Adkins
  7.  
  8.     Copyright:    © 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <7>     7/16/96    RA        Compile stand alone
  13.          <6>     6/27/96    TJ        Added GetgBinding to enable others to get
  14.                                     the binding session instead of using the
  15.                                     global.
  16.          <5>     6/24/96    RA        T10025: Adjustments for CORBA compliant
  17.                                     API.
  18.          <4>     6/23/96    TJ        Included ODSessn.xh
  19.          <3>     6/21/96    RA        T10025: Deprecated most utils for
  20.                                     implementors, obsoleted most for parts
  21.          <2>     5/23/96    RA        1330687: BndNSUtl should use
  22.                                     platformFile->read instead of FSRead
  23.  
  24.     To Do:
  25. */
  26.  
  27. #ifndef _BNDNSUTL_
  28. #define _BNDNSUTL_
  29.  
  30. #ifndef _ODTYPES_
  31. #include <ODTypes.h>
  32. #endif
  33.  
  34. #ifndef _PLFMFILE_
  35. #include "PLFMFile.h"
  36. #endif
  37.  
  38. //==============================================================================
  39. // Classes used by this interface
  40. //==============================================================================
  41. class    ODTypeList;
  42. class    EditorSet;
  43. class    ODNameSpaceManager;
  44. class    ODStorageUnitView;
  45. class    ODPart;
  46. class    ODSession;
  47. class     ODBinding;
  48.  
  49. //==============================================================================
  50. // functions
  51. //==============================================================================
  52. extern "C" {
  53.  
  54. void InitBindingNamespaceUtils(ODSession* session);
  55.     // New in OD 1.1, you must call this before calling any of the routines
  56.     // below that take an ODNameSpaceManager* as a param.
  57.     // These routines have been reimplemented as methods on the ODBinding object.
  58.     // The routines below are deprecated in OD 1.1. Their new implementation will
  59.     // work but you should really be calling the new ODBinding API's directly.
  60.     // If you want to use these depricated routines to afford a degree of source
  61.     // compatibility, you must add a call to InitBindingNamespaceUtils before 
  62.     // making any calls to these utils.
  63.  
  64. ODBinding* GetgBinding();
  65.  
  66. #ifdef _OD_IMPL_
  67.  
  68. ODEditor SetSysPrefEditorForKind(ODNameSpaceManager* theNameSpaceManager, 
  69.                                     ODType kind, ODEditor editor);
  70.     // Sets the system-wide preferred editor for the argument data kind.
  71.     // This routine will overwrite any preference set by the user.
  72.  
  73. ODEditor SetSysPrefEditorForCategory(ODNameSpaceManager* theNameSpaceManager, 
  74.                                     ODType category,ODEditor editor);
  75.     // Sets the system-wide preferred editor for the argument data category.
  76.     // This routine will overwrite any preference set by the user.
  77.  
  78. ODEditor GetSysPrefEditorForKind(ODNameSpaceManager* theNameSpaceManager, 
  79.                                     ODType kind);
  80.     // Returns the system-wide preferred editor for the argument data kind.
  81.     // A null value is returned if no preference has been specified.
  82.     // This routine checks to ensure that the preferred editor actually exists;
  83.     // if it does not, the preference is canceled and null is returned.
  84.  
  85. ODEditor GetSysPrefEditorForCategory(ODNameSpaceManager* theNameSpaceManager, 
  86.                                     ODType category);
  87.     // Returns the system-wide preferred editor for the argument data category.
  88.     // A null value is returned if no preference has been specified.
  89.  
  90. ODTypeList* GetCategoriesOfKind(ODNameSpaceManager* theNameSpaceManager, 
  91.                                     ODType kind);
  92.     // Returns the categories of the argument data kind, in the content of the
  93.     // argument storage unit.  The client must dispose of the result.
  94.  
  95. #endif
  96.  
  97. ODBoolean GetUserKindFromKind( ODNameSpaceManager* theNameSpaceManager, 
  98.                                     ODType kind, ODName** name );
  99. ODBoolean GetUserEditorFromEditor( ODNameSpaceManager* theNameSpaceManager, 
  100.                                     ODType editor, ODName** name );
  101. ODBoolean GetUserCatFromCat( ODNameSpaceManager* theNameSpaceManager, 
  102.                                     ODType category, ODName** name );
  103.  
  104. #ifdef _OD_IMPL_
  105.  
  106. ODOSType ODGetODOSTypeForKind(ODNameSpaceManager* theNmSpcMgr, ODType kind);
  107.  
  108. ODBoolean EditorSupportsKind( ODNameSpaceManager* theNameSpaceManager, 
  109.                                     ODEditor editor, ODType kind );
  110.         // Returns true if the argument editor supports the argument data type
  111.         // without translation.
  112.  
  113. ODBoolean GetAllEditorsForCategory( ODNameSpaceManager* theNameSpaceManager,
  114.                                 ODType category, EditorSet* theEditorSet );
  115.         // Returns the set of Editors supporting the argument data category without translation.
  116.  
  117. ODBoolean GetAllEditorsForKind(ODNameSpaceManager* theNameSpaceManager,
  118.                                 ODType kind, EditorSet* theEditorSet);
  119.         // Returns the set of Editors supporting the argument data kind without translation.
  120.  
  121. void GetAllKindsForEditor(ODNameSpaceManager* theNmSpcMgr,
  122.                                 ODTypeList*    kindList, ODEditor editorID);
  123.  
  124. ODULong ReadSize(PlatformFile* file, ODStorageUnitView* view);
  125.  
  126. void ReadBytes(PlatformFile* file, ODStorageUnitView* view,
  127.                         ODPtr bytes, ODULong* length);
  128.  
  129. #endif
  130.  
  131. EditorSet* ODGetEditorSetFromResFile(ODSShort resRefNum);
  132.  
  133.         // Returns the set of Editors IDs (if any) found in this file
  134.  
  135. EditorSet* ODGetEditorSetFromNMAP(ODHandle nmap );
  136.  
  137. }    // End of extern "C" {
  138.  
  139. #endif // _BNDNSUTL_
  140.